<html>
<head>
<title>Automatic Grading System - Project 1A</title>
</head>
<body style="font-family:'arial'">
<h1>Project 1A</h1>

<table width='600' border = '1'>
<tr >
<th align='left' width='200'><a href='../index.html'>RETURN TO MAIN</a></th>
<th align='left' width='200'><a href='../proj1b/main.html'>PROJECT 1B</a></th>
<th align='left' width='200'><a href='../proj2/main.html'>PROJECT 2</a></th>
</tr>
<table>

<hr>
Source Code is available at: <a href='https://bitbucket.org/chucheng/cs143_autograding'>https://bitbucket.org/chucheng/cs143_autograding</a>. Please consult ChuCheng Hsieh for access (chucheng@ucla.edu)

<hr>

<b>OVERVIEW</b><br>
This page has the detailed instructions on how to use the automatic grading system to grade the project 1A. Project 1A requires students to submit a web calculator in PHP. In order to test  student's work, the PHP page needs to be deployed in Apache. The system will place the submission directory in the corresponding location if it is not already and perform the grading. It will then grade student's work with the testcases in config.py. The entire process should not take longer than 5 seconds. Please read the instructions below for more details.

<br>
<hr>
<div style="width:600px;height:160px;border:2px dotted black;">
<b><u>BEFORE GRADING:</u></b>
<ul>
<li>Please install the same environment prepared by John Cho. Instruction can be found at <a href='../index.html'>main page</a>.</li>
<li>Please set up internet connection for the virtual machine according to the instruction above.</li>
<li>Please make sure your student submission directory follow the required <a href='#structure'>structure</a>.</li>
</ul>
</div>

<br>

<div style="width:725px;height:1800px;border:2px dotted black;">
<b><u>HOW TO RUN THE PROGRAM:</u></b>
<h5 id='structure'>STEP1:</h5>
<p>Check the submission directory format.
<ol>
<li>The submission directory will contain directories with student's submission (named with their own id)</li>
<li>The student's directory will contain their work. There should be calculator.php and a README file for Project 1A.</li>
</ol>
</p>
<div style="width:720px;height:370px;border:2px solid black;"><img src='./p1a/step1.jpg' alt='This screenshot shows the submission directory structure'></div>
<br>
<h5>STEP2:</h5>
Run the python script with your arguments. Please find the available <a href='#cfg'>arguments</a> below.<br> <div style="font-size:10pt"><b><i>- Type "./main.py" to execute the program.</b></i></div>
<div style="width:720px;height:33px;border:2px solid black;"><img src='./p1a/step2.jpg' alt='This screenshot shows how to run the script with specified submission directory and the process log output file'></div>

<h5>STEP3: <font color='red'>GRADING COMPLETED!!</font></h5>
Please find the grading result in "<b>RESULT/gradebook.txt</b>". This directory is generated in the grading process, and the gradebook file is in the tab delimited form.
<div style="width:720px;height:260px;border:2px solid black;"><img src='./p1a/gradebook.jpg' alt='This screenshot shows the location of gradebook file'><br>
<img src='./p1a/result.jpg' alt='This screenshot shows the sample of gradebook file'/>
</div>
<br><br><br>
<b id='cfg'><u>CONFIGURATIONS:</u></b>
<br>

The configurations of this program can be found and modified in <b>config.py</b>. Moreover, some grading parameters are configured upon execution.

Before running the program, grader can provide the following configs:
<ul>
<li> Student submission directory [-s].<br> <div style="font-size:10pt"><b><i>[Default: The program will use the directory in ${HOME}/www/submissions/ for grading]</i></b></div></li>
<li> Query parameter for testing students' PHP page [-q].</li>
<li> Grade specific student's project only [-n].</li>
</ul>

<u style="font-size:10pt"><b>The following screenshot is the usage information of the grading script:</b></u>
<div style="width:722px;height:307px;border:2px solid black;"><img src='./p1a/help.jpg' alt='This screenshot shows the grading configuration usage page'></div>
<br>

The following parameters are also configurable in this module; however, they require user to modify the config.py manually.
<ol>
<li>The path where PHP file is deployed and will be used for testing.</li>
<li>The name of file to be tested. <div style="font-size:10pt"><b><i>[Default to be "calculator.php" in Project 1A]</i></b></div></li>
<li>Output gradebook default location and filename.</li>
<li>Testing cases, solutions, and points.</li>
</ol>
<br>
</div>


<br>
<u><b>IMPORTANT NOTES</b></u><br>
The process log has the information of submissions count, error if any, grading note, and total grading time of the grading script ...etc.
<div style="width:720px;height:370px;border:2px solid black;"><img src='./p1a/log.jpg' alt='This screenshot shows the sample of log file'></div>


</body>
</html>